/**
 * (c) ejb123.com. License information is online at www.ejb123.com.
 */
package com.ejb123.essentials.one;

import java.util.Locale;

/**
 * @author User
 *
 */
public class LocaleReview2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Locale currentDefault = Locale.getDefault();
		System.out.println(currentDefault.getDisplayCountry());
		
		localeList();
		
		countryCodesList();
	}
	
	public static void localeList() {
		Locale[] locales = Locale.getAvailableLocales();
		for (int i = 0; i < locales.length; i++) {
			Locale locale = locales[i];
			System.out.print(locale.getDisplayCountry());
			System.out.print(",");
			System.out.print(locale.getISO3Country());
			System.out.print(",");
			System.out.print(locale.getDisplayLanguage());
			System.out.println();
		}
		System.out.printf("There were %d locales listed.\n", locales.length);
	}
	
	public static void countryCodesList() {
		String[] countryCodes = Locale.getISOCountries();
		for (int i = 0; i < countryCodes.length; i++) {
			String countryCode = countryCodes[i];
			System.out.println(countryCode);
		}
		
		System.out.printf("There were %d countries listed.\n", countryCodes.length);
	}

}
